package cn.dapeng.designPatterns.builder.t02;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Person {

    private Integer id;

    private String name;

    private String gender;

    private Double score;

    private int weight;

    private Person() {
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", score=" + score +
                ", weight=" + weight +
                '}';
    }

    static class PersonBuilder {
        Person person = new Person();

        public PersonBuilder personBuilder(Integer id, String name, String gender) {
            person.setId(id);
            person.setName(name);
            person.setGender(gender);
            return this;
        }

        public PersonBuilder score(Double score) {
            person.setScore(score);
            return this;
        }

        public PersonBuilder weight(int weight) {
            person.setWeight(weight);
            return this;
        }

        public Person builder() {
            return person;
        }

    }
}
